using System;

public class Demo
{
    // 打印100以内质数
    public void PrintPrimes()
    {
        Console.WriteLine("100以内质数：");
        for (int i = 2; i < 100; i++)
        {
            bool isPrime = true;
            for (int j = 2; j < i; j++)
                if (i % j == 0) { isPrime = false; break; }
            if (isPrime) Console.Write(i + " ");
        }
        Console.WriteLine();
    }

    // 打印1000以内水仙花数
    public void PrintNarcissistic()
    {
        Console.WriteLine("1000以内水仙花数：");
        for (int i = 100; i < 1000; i++)
        {
            int a = i / 100, b = i / 10 % 10, c = i % 10;
            if (a*a*a + b*b*b + c*c*c == i)
                Console.Write(i + " ");
        }
        Console.WriteLine();
    }
}